package com.hch.maker.cli.command;


import lombok.Data;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;

import java.io.IOException;

/**
 * @author 86134
 * @version 1.0
 * @description TODO
 * @date 2024/7/29 15:00
 */
@Command(name = "generate", mixinStandardHelpOptions = true)
@Data
public class TestArgsCommand implements Runnable{

    @Option(names = {"--needGit"},echo = true, description = "是否生成.gitignore文件", arity = "0..1", interactive = true)
    private boolean needGit = true;

    @Option(names = {"-l", "loop"},echo = true, description = "是否循环", arity = "0..1", interactive = true)
    private boolean loop;

    @CommandLine.ArgGroup(exclusive = false,heading = "核心模板%n")
    MainTemplate mainTemplate = new MainTemplate();

    @Override
    public void run() {
        System.out.println(loop);
        System.out.println(needGit);
        System.out.println(mainTemplate);
    }

    @Data
    public class MainTemplate{
        @CommandLine.Option(names = {"-o", "outputText"},echo = true, description = "输出信息", arity = "0..1", interactive = true)
        private String outputText;

        @CommandLine.Option(names = {"-a", "author"},echo = true, description = "作者名称", arity = "0..1", interactive = true)
        private String author;

    }

    public static void main(String[] args) {
        CommandLine commandLine = new CommandLine(TestArgsCommand.class);
        args = new String[]{"-a=lidog"};
        commandLine.execute(args);
    }




}
